import App from './App'
import moment from 'moment'
import {
	format,
	render,
	cancel,
	register
} from 'timeago.js';
import {
	PICTURE_URL
} from "@/utils/config.js"
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

//全局过滤器
Vue.filter('dateFormat', date => {
	date = parseInt(date) * 1000
	let nowdate = new Date().getTime()
	if ((nowdate - date) > (1000 * 60 * 60 * 24 * 1)) {
		return moment(date).format('YYYY-MM-DD hh:mm:ss')
	} else {
		return format(date, 'zh_CN');
	}
})
Vue.filter('imageFilter', (image) => {
	return PICTURE_URL + image
})
// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif
